﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Caliburn.Core;
using System.Disposables;
using Caliburn.PresentationFramework.ApplicationModel;

namespace PCUserTimer.ViewModels
{
    public class BreakViewModel : ActivityViewModelBase
    {
        public BreakViewModel(int minutes)
            : base(minutes)
        {
        }

        public override void ManuallyFinish()
        {
            base.ManuallyFinish();
            Popup.Conceal();
        }

        public override string Status
        {
            get { return HasLapsed ? "Break is over" : EndsAtText; }
        }

        string EndsAtText
        {
            get { return string.Format(@"Break ends in {0}, at {1:HH:mm}", ObjectFormatter.Format(EndsAt - DateTimeOffset.Now), EndsAt); }
        }
    }
}
